Skip to content

Add self contained basic test firmware - #343

Merged
LeeNX merged 4 commits into
lemmingDev:masterfrom
LeeNX:leet-ci-test-firmware
Sep 6, 2026
Merged

LeeNX merged 4 commits into
lemmingDev:masterfrom
LeeNX:leet-ci-test-firmware

Conversation

@LeeNX

@LeeNX LeeNX commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Looking to cover the needs for #342

LeeNX and others added 4 commits August 27, 2026 14:49
Turn test/ci_build into a no-wiring, no-extra-libs diagnostic firmware and
publish flashable binaries so people can rule out local-toolchain
differences without building anything (issue lemmingDev#342).

- src/main.cpp: on connect, auto-press BUTTON_3..BUTTON_8 on a timer
  (BUTTON_1/2 = A/B accept/back on Android, deliberately skipped), walk the
  battery level and power state, expose NUS (greeting + periodic status +
  help/status commands), and fill every Device Information Service
  characteristic. Trim the HID descriptor (8 buttons, 1 unused hat, no axes)
  so Android parses button offsets correctly.
- inject_version.py: set BLE_GAMEPAD_LIB_VERSION from library.properties +
  git sha, reported as the Software Revision characteristic.
- merge_firmware.py: emit firmware-factory.bin, flashable at offset 0x0.
- platformio.ini: shared [env] section; c6 still disabled.
- platformio.yml: upload test-firmware-<board> artifacts, add a
  workflow_dispatch ref input for ad-hoc builds, write flashing steps to the
  run summary.
- release.yml: attach the firmware binaries to GitHub releases.
- test/ci_build/README.md: what it does and how to get/flash a binary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tuning

- inject_version.py: add BLE_GAMEPAD_BUILD_TIME (fresh UTC stamp every build,
  also forces main.cpp to recompile); boot line now prints build id + timestamp
  so you can confirm an upload actually landed.
- NUS: track subscription state and only push the periodic status line when a
  client is subscribed (was logging "no peer connected - dropped").
- Diagnostics: 1 s heartbeat with the step-timer deltas, log each button
  press/release, hold buttons 350 ms (visible in a tester), run the first step
  of each activity immediately on connect.
- Tuning for Android: button range and stick throw are now easy to adjust via
  the #defines; right-stick deflection kept under ~50% to avoid synthesised
  D-pad nav. platformio.ini defaults BLE_GAMEPAD_DEBUG=0.
- README: "Watching the serial log" section - serialmonitor.org (Web Serial,
  Chromium-only like esptool-js), port names per OS.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Header and the FIRST/LAST_TEST_BUTTON note described the old 24-button /
BUTTON_25..32 / 250 ms setup; update them to match the code (BUTTON_COUNT,
~2.5 s interval, 350 ms hold, range as a #define) and add a line explaining
the loop heartbeat.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Memory usage change @ 4410936

Board flash % RAM for global variables %
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32c3 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32c6 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32s3 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/CharacteristicsConfiguration
flash
% examples/CharacteristicsConfiguration
RAM for global variables
% examples/DrivingControllerTest
flash
% examples/DrivingControllerTest
RAM for global variables
% examples/Fightstick
flash
% examples/Fightstick
RAM for global variables
% examples/FlightControllerTest
flash
% examples/FlightControllerTest
RAM for global variables
% examples/ForcePairingMode
flash
% examples/ForcePairingMode
RAM for global variables
% examples/Gamepad
flash
% examples/Gamepad
RAM for global variables
% examples/GetPeerInfo
flash
% examples/GetPeerInfo
RAM for global variables
% examples/IndividualAxes
flash
% examples/IndividualAxes
RAM for global variables
% examples/Keypad4x4
flash
% examples/Keypad4x4
RAM for global variables
% examples/MotionController
flash
% examples/MotionController
RAM for global variables
% examples/MultipleButtons
flash
% examples/MultipleButtons
RAM for global variables
% examples/MultipleButtonsAndHats
flash
% examples/MultipleButtonsAndHats
RAM for global variables
% examples/MultipleButtonsDebounce
flash
% examples/MultipleButtonsDebounce
RAM for global variables
% examples/PotAsAxis
flash
% examples/PotAsAxis
RAM for global variables
% examples/SetBatteryLevel
flash
% examples/SetBatteryLevel
RAM for global variables
% examples/SetBatteryPowerState
flash
% examples/SetBatteryPowerState
RAM for global variables
% examples/SingleButton
flash
% examples/SingleButton
RAM for global variables
% examples/SingleButtonDebounce
flash
% examples/SingleButtonDebounce
RAM for global variables
% examples/SpecialButtons
flash
% examples/SpecialButtons
RAM for global variables
% examples/TestAll
flash
% examples/TestAll
RAM for global variables
% examples/TestFeatureReports
flash
% examples/TestFeatureReports
RAM for global variables
% examples/TestReceivingOutputReport
flash
% examples/TestReceivingOutputReport
RAM for global variables
%
esp32:esp32:esp32 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32c3 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32c6 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32s3 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/CharacteristicsConfiguration<br>flash,%,examples/CharacteristicsConfiguration<br>RAM for global variables,%,examples/DrivingControllerTest<br>flash,%,examples/DrivingControllerTest<br>RAM for global variables,%,examples/Fightstick<br>flash,%,examples/Fightstick<br>RAM for global variables,%,examples/FlightControllerTest<br>flash,%,examples/FlightControllerTest<br>RAM for global variables,%,examples/ForcePairingMode<br>flash,%,examples/ForcePairingMode<br>RAM for global variables,%,examples/Gamepad<br>flash,%,examples/Gamepad<br>RAM for global variables,%,examples/GetPeerInfo<br>flash,%,examples/GetPeerInfo<br>RAM for global variables,%,examples/IndividualAxes<br>flash,%,examples/IndividualAxes<br>RAM for global variables,%,examples/Keypad4x4<br>flash,%,examples/Keypad4x4<br>RAM for global variables,%,examples/MotionController<br>flash,%,examples/MotionController<br>RAM for global variables,%,examples/MultipleButtons<br>flash,%,examples/MultipleButtons<br>RAM for global variables,%,examples/MultipleButtonsAndHats<br>flash,%,examples/MultipleButtonsAndHats<br>RAM for global variables,%,examples/MultipleButtonsDebounce<br>flash,%,examples/MultipleButtonsDebounce<br>RAM for global variables,%,examples/PotAsAxis<br>flash,%,examples/PotAsAxis<br>RAM for global variables,%,examples/SetBatteryLevel<br>flash,%,examples/SetBatteryLevel<br>RAM for global variables,%,examples/SetBatteryPowerState<br>flash,%,examples/SetBatteryPowerState<br>RAM for global variables,%,examples/SingleButton<br>flash,%,examples/SingleButton<br>RAM for global variables,%,examples/SingleButtonDebounce<br>flash,%,examples/SingleButtonDebounce<br>RAM for global variables,%,examples/SpecialButtons<br>flash,%,examples/SpecialButtons<br>RAM for global variables,%,examples/TestAll<br>flash,%,examples/TestAll<br>RAM for global variables,%,examples/TestFeatureReports<br>flash,%,examples/TestFeatureReports<br>RAM for global variables,%,examples/TestReceivingOutputReport<br>flash,%,examples/TestReceivingOutputReport<br>RAM for global variables,%
esp32:esp32:esp32,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32c3,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32c6,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32s3,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@lemmingDev

Copy link
Copy Markdown
Owner

lets merge

@LeeNX LeeNX changed the title [WIP] Add self contained basic test firmware Add self contained basic test firmware Sep 6, 2026
@LeeNX
LeeNX marked this pull request as ready for review September 6, 2026 11:42
@LeeNX
LeeNX merged commit cca5c5d into lemmingDev:master Sep 6, 2026
9 checks passed
@LeeNX
LeeNX deleted the leet-ci-test-firmware branch September 6, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants